package com.example.demospringboot.controller;

import com.example.demospringboot.beanentity.User;
import com.example.demospringboot.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private LoginService loginService;

    @GetMapping("login")
    public String login(User user){
        if (loginService.login(user))
        return "登陆成功！";
        else return "登陆失败";
    }
}
